<app-common-header [title]="'auth.reset-pwd.input-mobile.title' | translate"></app-common-header>
<ion-content>
<div class="login_content">
  <form [formGroup]="validateForm" name="validateForm" role="form" (ngSubmit)="toInputVerificationCode()">
  <ion-grid>
    <ion-row>
      <ion-col>
        <ion-label class="login_title">
          {{'auth.reset-pwd.input-mobile.resetpwd' | translate}}
        </ion-label>
      </ion-col>
    </ion-row>
    <ion-row>
      <ion-col>
        <ion-header class="login_word">
          {{'auth.reset-pwd.input-mobile.please_enter_mobile' | translate}}
        </ion-header>
      </ion-col>
    </ion-row>
    <ion-row>
      <ion-col>
        <ion-grid>
          <ion-row class="input-row">
            <ion-col size="4">
              <ion-select placeholder="Select" interface="popover" formControlName="countryCode" [(ngModel)]="appUser.countryCode">
                <ion-select-option value="86">+86</ion-select-option>
                <ion-select-option value="62">+62</ion-select-option>
              </ion-select>
            </ion-col>
            <ion-col size="8">
              <ion-input type="text" maxlength=30 placeholder="{{'auth.reset-pwd.input-mobile.mobile_number' | translate}}" 
              clearInput="true" 
              required
              autofocus
              formControlName="mobileNumber"
              [(ngModel)]="appUser.mobileNumber"></ion-input>
            </ion-col>
          </ion-row>
          <ion-row>
            <ion-col size="12" *ngIf="mobileNumber.invalid && (mobileNumber.dirty || mobileNumber.touched)">
              <div *ngIf="mobileNumber.errors.required" class="form-error-item">
                {{'auth.reset-pwd.input-mobile.mobileNumber_required' | translate}}
              </div>
            </ion-col>
          </ion-row>
        </ion-grid>
      </ion-col>
    </ion-row>
    <ion-row>
      <ion-col>
        <ion-button class="customer-btn" fill="clear" expand="block" type="submit" [disabled]='validateForm.invalid || loading'>
          {{'auth.reset-pwd.input-mobile.next' | translate}}
          <ion-spinner [hidden]="!loading"></ion-spinner>
        </ion-button>
      </ion-col>
    </ion-row>
  </ion-grid>
</form>
</div>
</ion-content>


